<!DOCTYPE html>
<html class="no-js" lang="en">

	<head>
		<meta name="layout" content="aqvLayout2">
		<meta http-equiv="Content-type" content="text/html; charset=utf-8">
		<meta charset="utf-8"/>
		<title>A quien voto | Detalle Politico</title>
	</head>
	<body>

		<!-- SUBHEADER
		================================================== -->
		<div id="subheader">
			<div class="row">
				<div class="twelve columns">
					<p class="left">
						 Detalle Politco : ${politicianInstance?.surName} ${politicianInstance?.name}
					</p>
					<p class="right">
						<!-- this link could be "ver siguiente politico" acording to the search criteria -->
						<g:link controller="politician" action="index">Ver otros politicos</g:link>
					</p>
				</div>
			</div>
		</div>
		<div class="hr">
		</div>
		<!-- CONTENT 
		================================================== -->
		<div class="row">
			<!-- PROJECT DESCRIPTION-->
			<g:if test="${flash.message}">
				<div class="message" role="status">${flash.message}</div>
			</g:if>
			<div class="six columns">
				<div class="sectiontitle">
					<h4>${politicianInstance?.name} ${politicianInstance?.surName}</h4>
<%--					<a href="${createLink(controller : 'Politician', action:'show', params: [id:politicianInstance.id])}"></a>--%>
<%--					consider adding an edit icon--%>
					<g:if test="${session?.user && session?.user.politicalParty.id == politicianInstance.politicalParty.id}">
						<g:link controller="politician" action="edit" id="${politicianInstance.id}">Editar</g:link>
					</g:if>
				</div>
				<p>
					${politicianInstance?.description}
				</p>
				<dl class="tabs">
					<dd class="active"><a href="#simple1">Datos personales</a></dd>
					<dd><a href="#simple2">Proyectos</a></dd>
					<dd><a href="#simple3">WHAAAA !?!?</a></dd>
				</dl>
				<ul class="tabs-content">
					<li class="active" id="simple1Tab">

						<div class="six columns noleftmargin">
							<p><span>Apellido: </span><span>${politicianInstance?.surName}</span></p>
							<p><span>Nombre: </span><span>${politicianInstance?.name}</span></p>
							<p><span>Fec. nac.: </span><span>${politicianInstance?.birthDate}</span></p>
						</div>

						<div class="six columns">
							<p><span>Partido politico: </span><span>${politicianInstance?.politicalParty.name}</span></p>
							<p><span>Cargo politico: </span><span>${politicianInstance?.politicalPartyRole.tittle}</span></p>
						</div>

					</li>
					<li id="simple2Tab">
					
						<g:if test="${politicianInstance?.projects}">
							<g:each in="${politicianInstance.projects}" var="p">
								<g:link controller="project" action="show" id="${p.id}">${p?.name}</g:link>
								<br/>
								${p?.description}
							</g:each>
						</g:if>
						<g:else>
							<span>parece que no hay ningun proyecto para este politico, 
							<g:link controller="project" action="create" params="['politician.id': politicianInstance?.id]">agrega uno:</g:link></span>
						</g:else>
					
						<%--<p>
							 Consectetur adipiscing elit. Et non ex maxima parte de tota iudicabis? Item de contrariis, a quibus ad genera formasque generum.
						</p>
						<p>
							<img src="images/check.png" alt=""> genera formasque
						</p>
						<p>
							<img src="images/check.png" alt=""> quibus ad genera
						</p>
						<p>
							 Et non ex maxima parte de tota iudicabis? Item de contrariis, a quibus ad genera formasque generum venerunt. Sit enim idem caecus, debilis. Duo Reges: constructio interrete.
						</p>
					--%>
					</li>
					<li id="simple3Tab">
					<p>
						<i>"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Et non ex maxima parte de tota iudicabis? Item de contrariis, a quibus ad genera formasque generum."</i>
					</p>
					<p>
						<i>"Adipiscing elit. Et non ex maxima parte de tota iudicabis? Item de contrariis, a quibus ad genera formasque generum."</i>
					</p>
					</li>
				</ul>
			</div>
			<!-- end main content-->
			<!-- SLIDER-->
			<div class="six columns">
				<div class="slider-wrapper theme-default">
					<div id="slider" class="nivoSlider detailslider">
<%--						<img src=${resource(dir: '/images/politicians/'+politicianInstance.surName +'_' +politicianInstance.name+'/', file: politicianInstance.profilePic)} --%>
<%--								width="440" height="272"/>--%>
					<img src="data:image/png;base64,${politicianInstance.profilePic.encodeBase64()}" 
						width="440" height="272"/>
						<img src="images/temp/nivo2.jpg" data-thumb="" alt=""/>
						<img src="images/temp/nivo3.jpg" data-thumb="" alt=""/>
					</div>
				</div>
			</div>
			<!-- end sliderr-->
		</div>
		<div class="hr">
		</div>

	</body>
</html>